<html>
<head><meta charset="utf-8"><title>meeting 2020-10-01 · t-compiler/wg-rfc-2229 · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/index.html">t-compiler/wg-rfc-2229</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html">meeting 2020-10-01</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="211668532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211668532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211668532">(Sep 29 2020 at 19:01)</a>:</h4>
<p>Agenda:</p>
<ul>
<li>Close closure pretty print <a href="https://github.com/rust-lang/rust/pull/77069">https://github.com/rust-lang/rust/pull/77069</a></li>
<li>Discuss remaining issues on capture analysis inference variable instead of tuple (<a href="https://github.com/sexxi-goose/rust/pull/23">https://github.com/sexxi-goose/rust/pull/23</a>)</li>
<li>Discuss any concerns with doing min capture analysis after processing all expressions (i.e. after handling all the callbacks) instead of  minimizing while processing the expressions (during the consume/mutate/borrow callbacks)</li>
</ul>



<a name="211710374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211710374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211710374">(Sep 30 2020 at 03:06)</a>:</h4>
<p>Discuss if there something that we should keep in mind for migration lints for edition 2021</p>



<a name="211932993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211932993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211932993">(Oct 01 2020 at 16:00)</a>:</h4>
<p>Are we doing zoom?</p>



<a name="211933294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211933294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211933294">(Oct 01 2020 at 16:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="211933711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211933711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211933711">(Oct 01 2020 at 16:05)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="281950">@Aman Arora</span>, sorry</p>



<a name="211933714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211933714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211933714">(Oct 01 2020 at 16:05)</a>:</h4>
<p>lost track of time</p>



<a name="211934008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211934008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211934008">(Oct 01 2020 at 16:07)</a>:</h4>
<p>Agenda:</p>
<ul>
<li>[*] Close closure pretty print <a href="https://github.com/rust-lang/rust/pull/77069">https://github.com/rust-lang/rust/pull/77069</a></li>
<li>[ ] Discuss remaining issues on capture analysis inference variable instead of tuple (<a href="https://github.com/sexxi-goose/rust/pull/23">https://github.com/sexxi-goose/rust/pull/23</a>)</li>
<li>[ ] Discuss if there something that we should keep in mind for migration lints for edition 2021</li>
<li>[ ] Discuss any concerns with doing min capture analysis after processing all expressions (i.e. after handling all the callbacks) instead of  minimizing while processing the expressions (during the consume/mutate/borrow callbacks)</li>
</ul>



<a name="211934117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211934117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211934117">(Oct 01 2020 at 16:07)</a>:</h4>
<p>Do you want to chat on Zoom?</p>



<a name="211934180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211934180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211934180">(Oct 01 2020 at 16:08)</a>:</h4>
<p>Let's try it, mnight be useful</p>



<a name="211934206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211934206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211934206">(Oct 01 2020 at 16:08)</a>:</h4>
<p>Sure</p>



<a name="211934592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211934592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211934592">(Oct 01 2020 at 16:11)</a>:</h4>
<p>interior-mutability.stderr</p>



<a name="211934798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211934798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211934798">(Oct 01 2020 at 16:13)</a>:</h4>
<p>I think u disconnected</p>



<a name="211940474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211940474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211940474">(Oct 01 2020 at 16:56)</a>:</h4>
<p>btw <span class="user-mention" data-user-id="116883">@tmandry</span> or <span class="user-mention" data-user-id="116107">@davidtwco</span> would be able to help with this code, <span class="user-mention" data-user-id="281950">@Aman Arora</span> (I'm cc'ing them :)</p>



<a name="211940495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211940495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211940495">(Oct 01 2020 at 16:56)</a>:</h4>
<p>(we're looking a bit at the diagnostics code that is specialized to generators being send<br>
)</p>



<a name="211945044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211945044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211945044">(Oct 01 2020 at 17:27)</a>:</h4>
<p>The error we are seeing is with src/test/ui/async-await/issue-70818.stderr  in <a href="https://github.com/sexxi-goose/rust/pull/23">https://github.com/sexxi-goose/rust/pull/23</a></p>
<p>To give some background about this PR and closure capture analysis in general: </p>
<ul>
<li>Before this PR we would create a tuple of inference variable each infer var corresponding to type of an upvar</li>
<li>RFC 2229: capturing precise paths so eg: capturing foo.x.y instead of foo, if foo.x.y is the only path starting at foo used in the closure being analyzed. With RFC 2229 the number of upvars and hence the arity of the tuple isn't known</li>
<li>What we now do with this PR is create a single infer variable and then replace it with a tuple of types once we have figured out number of captured places.</li>
</ul>



<a name="211967378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211967378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211967378">(Oct 01 2020 at 20:10)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> what can I help with specifically?</p>



<a name="211967444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211967444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211967444">(Oct 01 2020 at 20:11)</a>:</h4>
<p>it looks like the generator-specific diagnostics code isn't triggering there anymore, is that what you're trying to solve?</p>



<a name="211967655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211967655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211967655">(Oct 01 2020 at 20:12)</a>:</h4>
<p>Yea</p>



<a name="211997282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211997282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211997282">(Oct 02 2020 at 02:06)</a>:</h4>
<p>Sorry I was busy earlier, and didn't add enough details. One thing that is probably causing the issue with diagnostics is an extra obligation. </p>
<p>So from what I understand we have a chain of obligations. <br>
[Generator] -&gt; [list of captured types] -&gt; Bound</p>
<p>So for the generator to meet the bound the list of captured types must also meet the bound. With the change we have made, the chain however now looks like</p>
<p>[Generator] -&gt; [Inference Variable]  -&gt; Bound</p>
<p>Where the inference variable once resolved turns into a tuple containing the captured types, which in turn sets the obligations on the captured types.</p>
<p>From our discussion this morning, it might be possible that the added level of indirection results in some conditions to fail and therefore resulting in poor diagnostics here:  <a href="https://github.com/sexxi-goose/rust/pull/23/files#diff-b77011eccfaec43053e1271d0c139e66">https://github.com/sexxi-goose/rust/pull/23/files#diff-b77011eccfaec43053e1271d0c139e66</a></p>



<a name="211997296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/211997296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#211997296">(Oct 02 2020 at 02:07)</a>:</h4>
<p>I haven't had a change to investigate this possibility and like if I get your thoughts on this. </p>
<p>Thanks <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="212133463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/212133463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#212133463">(Oct 02 2020 at 21:55)</a>:</h4>
<p>Yeah that does sound like a possibility. The conditions for that error message are in this function.. <a href="https://github.com/rust-lang/rust/blob/8876ffc9235dade728e1fbc4be4c85415fdd0bcd/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs#L1265:L1265"><code>maybe_note_obligation_cause_for_async_await</code></a></p>



<a name="212133559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/212133559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#212133559">(Oct 02 2020 at 21:56)</a>:</h4>
<p>First step would be looking at debug logs in that function (and maybe diffing them before/after your change) to figure out what conditions are not being met</p>



<a name="212134573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/212134573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#212134573">(Oct 02 2020 at 22:10)</a>:</h4>
<p>Thank you, we'll probably spend some time on it over the weekend, I let you know how it goes <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="212326048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/212326048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#212326048">(Oct 05 2020 at 16:46)</a>:</h4>
<p>The code can be cleaned up here, but if the first thing we see is a tuple we ignore it. <br>
<a href="https://github.com/sexxi-goose/rust/pull/23/commits/5648be6b9e982c5277d44934ac6212c4c99dcd09">https://github.com/sexxi-goose/rust/pull/23/commits/5648be6b9e982c5277d44934ac6212c4c99dcd09</a></p>



<a name="212326373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/212326373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#212326373">(Oct 05 2020 at 16:49)</a>:</h4>
<p>I'm curious if this code ever runs before typeck? Reason I ask is, it relies on upvars_mentioned which is generated before typeck. After typechk we want to use closure_captures which will contain different (more precise) information. </p>
<p>by precision I mean if <code>foo.bar.baz</code> is used by the closure, closure will only capture that path and that is what will in closure captures. (upvars_mentioned will only have <code>foo</code>)</p>



<a name="212327078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/meeting%202020-10-01/near/212327078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/meeting.202020-10-01.html#212327078">(Oct 05 2020 at 16:55)</a>:</h4>
<p>Actually we do use typeck_results below it, so I'm assuming it should be fine</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>